<%@ page import="com.entity.Blog" %>
<%@ page import="java.util.List" %>
<%@ page import="com.service.BlogService" %>
<%@ page import="com.service.BlogServiceImpl" %><%--
  Created by IntelliJ IDEA.
  User: Elle
  Date: 2022/6/18
  Time: 8:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //用户处理列表==>uid=1&state=1&content=1

    //1、获取请求的数据
    String uid = request.getParameter("uid");
    String state = request.getParameter("state");
    String content = request.getParameter("content");

    //2、操作==》持久化==》数据库
    BlogService blogService = new BlogServiceImpl();
    List<Blog> list = blogService.findAll(); //获取数据
    if(uid!=null && state!=null){
    	list = blogService.findByParam(Integer.valueOf(uid),Integer.valueOf(state),content);
    }
    //3、页面跳转==》index.jsp==>传递数据==》list ==>转发
    request.setAttribute("blogList",list);
    request.getRequestDispatcher("index.jsp").forward(request, response);

%>